home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2002 November / SGI IRIX Base Documentation 2002 November.iso / usr / share / catman / u_man / cat1 / tttrace.z / tttrace
Encoding:
Text File  |  2002-10-03  |  16.5 KB  |  331 lines

  1.  
  2.  
  3.  
  4. ttttttttttttrrrraaaacccceeee((((1111))))                                                          ttttttttttttrrrraaaacccceeee((((1111))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      tttrace - trace ToolTalk calls and messages
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      ttttttttttttrrrraaaacccceeee [----0000FFFFCCCCaaaa] [----oooo _o_u_t_f_i_l_e ] [----SSSS _s_e_s_s_i_o_n | _c_o_m_m_a_n_d]
  13.      ttttttttttttrrrraaaacccceeee [----eeee _s_c_r_i_p_t | -f _s_c_r_i_p_t_f_i_l_e ] [----SSSS _s_e_s_s_i_o_n | _c_o_m_m_a_n_d]
  14.  
  15. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  16.      ttttttttttttrrrraaaacccceeee traces message traffic through the server for the indicated
  17.      ToolTalk _s_e_s_s_i_o_n, or runs _c_o_m_m_a_n_d with ToolTalk client tracing turned on.
  18.      If neither _s_e_s_s_i_o_n nor _c_o_m_m_a_n_d is given, the default session is traced.
  19.      By default, tracing terminates when ttttttttttttrrrraaaacccceeee exits.
  20.  
  21.      Tracing of ToolTalk functions looks like this:
  22.      [_p_i_d] _f_u_n_c_t_i_o_n__n_a_m_e(_p_a_r_a_m_s) = _r_e_t_u_r_n__v_a_l_u_e (_T_t__s_t_a_t_u_s)
  23.  
  24.      With the ----aaaa option, message attributes are printed after a one-line
  25.      summary of the message:
  26.      _T_t__s_t_a_t_e _T_t__p_a_r_a_d_i_g_m _T_t__c_l_a_s_s (_T_t__d_i_s_p_o_s_i_t_i_o_n in _T_t__s_c_o_p_e): _s_t_a_t_u_s == _T_t__s_t_a_t_u_s
  27.  
  28.      State changes are indicated by:
  29.      _o_l_d__s_t_a_t_e => _n_e_w__s_t_a_t_e.
  30.  
  31.      Deliveries are indicated by:
  32.      Tt_message => procid <_r_e_c_i_p_i_e_n_t__p_r_o_c_i_d>
  33.  
  34.      When dispatching is being traced, the reason for each dispatch is one of:
  35.  
  36.      tttttttt____mmmmeeeessssssssaaaaggggeeee____sssseeeennnndddd()
  37.      tttttttt____mmmmeeeessssssssaaaaggggeeee____rrrreeeejjjjeeeecccctttt()
  38.      tttttttt____mmmmeeeessssssssaaaaggggeeee____ffffaaaaiiiillll()
  39.      tttttttt____mmmmeeeessssssssaaaaggggeeee____rrrreeeeppppllllyyyy()
  40.      tttttttt____sssseeeessssssssiiiioooonnnn____jjjjooooiiiinnnn()
  41.      tttttttt____ffffiiiilllleeee____jjjjooooiiiinnnn()
  42.      tttttttt____mmmmeeeessssssssaaaaggggeeee____rrrreeeeppppllllyyyy()
  43.              A client called the indicated function.
  44.  
  45.      tttttttt____mmmmeeeessssssssaaaaggggeeee____sssseeeennnndddd____oooonnnn____eeeexxxxiiiitttt()
  46.              ttttttttsssseeeessssssssiiiioooonnnn is dispatching on_exit messages for a client that
  47.              disconnected before calling tttttttt____cccclllloooosssseeee().
  48.  
  49.      tttttttt____mmmmeeeessssssssaaaaggggeeee____aaaacccccccceeeepppptttt()
  50.              ttttttttsssseeeessssssssiiiioooonnnn is dispatching messages that had been blocked while a
  51.              ptype was being started.  The started client has now called
  52.              either tttttttt____mmmmeeeessssssssaaaaggggeeee____aaaacccccccceeeepppptttt() or tttttttt____mmmmeeeessssssssaaaaggggeeee____rrrreeeeppppllllyyyy() to indicate that
  53.              the ptype should be unblocked.
  54.  
  55.      TT_ERR_PTYPE_START
  56.              A ptype instance was started to receive the message, but the
  57.              start command exited before it connected to ttttttttsssseeeessssssssiiiioooonnnn.
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ttttttttttttrrrraaaacccceeee((((1111))))                                                          ttttttttttttrrrraaaacccceeee((((1111))))
  71.  
  72.  
  73.  
  74.      TT_ERR_PROCID
  75.              ttttttttsssseeeessssssssiiiioooonnnn lost its connection to the client that was working on
  76.              this request.
  77.  
  78.      ttsession -> ttsession
  79.              Another session wants this session to find recipients for the
  80.              message.
  81.  
  82.      ttsession <- ttsession
  83.              Another session wants to update (e.g. fail) a message originating
  84.              in this session.
  85.  
  86.      When dispatching is being traced, matching is indicated by one of
  87.      Tt_message & Tt_pattern {
  88.      Tt_message & ptype _p_t_i_d {
  89.      Tt_message & otype _o_t_i_d {
  90.  
  91.      The pattern or signature is printed, followed by
  92.      } == _m_a_t_c_h__s_c_o_r_e; [/* _m_i_s_m_a_t_c_h__r_e_a_s_o_n */]
  93.  
  94. OOOOPPPPTTTTIIIIOOOONNNNSSSS
  95.      ----0000   Turn off message tracing in _s_e_s_s_i_o_n, or run _c_o_m_m_a_n_d without message
  96.           tracing (i.e., with only call tracing).
  97.  
  98.      ----FFFF   Follow all children forked by _c_o_m_m_a_n_d or subsequently started in
  99.           _s_e_s_s_i_o_n by ttttttttsssseeeessssssssiiiioooonnnn.  Normally, only the indicated _c_o_m_m_a_n_d or
  100.           ttttttttsssseeeessssssssiiiioooonnnn instance is traced.  When ----FFFF is specified, the process id
  101.           is included with each line of trace output to indicate which process
  102.           generated it.
  103.  
  104.      ----CCCC   Do not trace client calls into the ToolTalk API.  Default is to
  105.           trace them.
  106.  
  107.      ----aaaa   Print all attributes, arguments, and context slots of traced
  108.           messages.  The default is to use only a single line when printing a
  109.           message on the trace output.
  110.  
  111.      ----eeee _s_c_r_i_p_t
  112.           Take _s_c_r_i_p_t as a ttttttttttttrrrraaaacccceeee setting.  See ttttttttttttrrrraaaacccceeeeffffiiiilllleeee(4).
  113.  
  114.      ----ffff _s_c_r_i_p_t_f_i_l_e
  115.           File to read ttttttttttttrrrraaaacccceeee settings from.  See ttttttttttttrrrraaaacccceeeeffffiiiilllleeee(4).  ----ffff ----
  116.           causes ttttttttttttrrrraaaacccceeee to read standard input until EOF, which may prevent
  117.           _c_o_m_m_a_n_d from using standard input.
  118.  
  119.      ----oooo _o_u_t_f_i_l_e
  120.           File to be used for the trace output.
  121.  
  122.           For session tracing, output goes to standard output of ttttttttttttrrrraaaacccceeee.
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ttttttttttttrrrraaaacccceeee((((1111))))                                                          ttttttttttttrrrraaaacccceeee((((1111))))
  137.  
  138.  
  139.  
  140.           For client tracing, output goes by default to standard error of
  141.           ttttttttttttrrrraaaacccceeee.  For client tracing, ----oooo ---- causes trace output to go to
  142.           standard output of ttttttttttttrrrraaaacccceeee.
  143.  
  144.           If the server for _s_e_s_s_i_o_n is running on a remote host and either
  145.              +o _o_u_t_f_i_l_e is not mounted on that host, or
  146.              +o the ----oooo option is omitted,
  147.           then ttttttttttttrrrraaaacccceeee will fail.
  148.  
  149.      ----SSSS _s_e_s_s_i_o_n
  150.           Session to trace.  Defaults to the _d_e_f_a_u_l_t _s_e_s_s_i_o_n -- the session
  151.           that tt_open() would contact.
  152.  
  153.      _c_o_m_m_a_n_d
  154.           The ToolTalk client command to invoke and trace.
  155.  
  156. EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  157.      Here we trace a client that registers a pattern and sends a notice that
  158.      matches it:
  159.  
  160.           % ttttttttttttrrrraaaacccceeee -a _m_y_c_l_i_e_n_t_p_r_o_g_r_a_m
  161.  
  162.      tt_open() = 0x51708=="7.jOHHM X 129.144.153.55 0" (TT_OK)
  163.      tt_fd() = 11 (TT_OK)
  164.      tt_pattern_create() = 0x50318 (TT_OK)
  165.      tt_pattern_category_set(0x50318, TT_OBSERVE) = 0 (TT_OK)
  166.      tt_pattern_scope_add(0x50318, TT_SESSION) = 0 (TT_OK)
  167.      tt_pattern_op_add(0x50318, 0x2f308=="Hello World") = 0 (TT_OK)
  168.      tt_default_session() = 0x519e0=="X 129.144.153.55 0" (TT_OK)
  169.      tt_pattern_session_add(0x50318, 0x519e0=="X 129.144.153.55 0") = 0 (TT_OK)
  170.      tt_pattern_register(0x50318) = 0 (TT_OK)
  171.      tt_message_create() = 0x51af0 (TT_OK)
  172.      tt_message_class_set(0x51af0, TT_NOTICE) = 0 (TT_OK)
  173.      tt_message_address_set(0x51af0, TT_PROCEDURE) = 0 (TT_OK)
  174.      tt_message_scope_set(0x51af0, TT_SESSION) = 0 (TT_OK)
  175.      tt_message_op_set(0x51af0, 0x2f308=="Hello World") = 0 (TT_OK)
  176.      tt_message_send(0x51af0)      ...
  177.                TT_CREATED => TT_SENT:
  178.                     TT_SENT TT_PROCEDURE TT_NOTICE (TT_DISCARD in TT_SESSION): 0 == TT_OK
  179.                     id:       0 7.jOHHM X 129.144.153.55 0
  180.                     op:       Hello World
  181.                     session:  X 129.144.153.55 0
  182.                     sender:        7.jOHHM X 129.144.153.55 0
  183.      = 0 (TT_OK)
  184.      tt_message_receive()     ...
  185.                Tt_message => procid <7.jOHHM X 129.144.153.55 0>
  186.                TT_SENT TT_PROCEDURE TT_NOTICE (TT_DISCARD in TT_SESSION): 0 == TT_OK
  187.                id:       0 7.jOHHM X 129.144.153.55 0
  188.                op:       Hello World
  189.                session:  X 129.144.153.55 0
  190.                sender:        7.jOHHM X 129.144.153.55 0
  191.                pattern:  0:7.jOHHM X 129.144.153.55 0
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ttttttttttttrrrraaaacccceeee((((1111))))                                                          ttttttttttttrrrraaaacccceeee((((1111))))
  203.  
  204.  
  205.  
  206.      = 0x51af0 (TT_OK)
  207.  
  208.      ttttttttsssseeeessssssssiiiioooonnnn's view of this traffic can be seen as follows.  Note that the
  209.      first message traced will almost always be ttttttttsssseeeessssssssiiiioooonnnn's reply to the
  210.      request sent it by ttttttttttttrrrraaaacccceeee.
  211.  
  212.           % ttttttttttttrrrraaaacccceeee -a
  213.  
  214.      tt_message_reply:
  215.                TT_SENT => TT_HANDLED:
  216.                     TT_HANDLED TT_PROCEDURE TT_REQUEST (TT_DISCARD in TT_SESSION): 0 == TT_OK
  217.                     id:       0 2.jOHHM X 129.144.153.55 0
  218.                     op:       Session_Trace
  219.                     args:
  220.                          TT_IN string: "> /tmp/traceAAAa002oL; version 1; states"[...]
  221.                     session:  X 129.144.153.55 0
  222.                     sender:        2.jOHHM X 129.144.153.55 0
  223.                     pattern:  0:X 129.144.153.55 0
  224.                     handler:  0.jOHHM X 129.144.153.55 0
  225.                     Tt_message => procid <2.jOHHM X 129.144.153.55 0>
  226.      tt_message_send:
  227.                TT_CREATED TT_PROCEDURE TT_NOTICE (TT_DISCARD in TT_SESSION): 0 == TT_OK
  228.                id:       0 7.jOHHM X 129.144.153.55 0
  229.                op:       Hello World
  230.                session:  X 129.144.153.55 0
  231.                sender:        7.jOHHM X 129.144.153.55 0
  232.                TT_CREATED => TT_SENT:
  233.                     TT_SENT TT_PROCEDURE TT_NOTICE (TT_DISCARD in TT_SESSION): 0 == TT_OK
  234.                     id:       0 7.jOHHM X 129.144.153.55 0
  235.                     op:       Hello World
  236.                     session:  X 129.144.153.55 0
  237.                     sender:        7.jOHHM X 129.144.153.55 0
  238.                Tt_message & Tt_pattern {
  239.                     id:       0:7.jOHHM X 129.144.153.55 0
  240.                     category: TT_OBSERVE
  241.                     scopes:        TT_SESSION
  242.                     sessions: X 129.144.153.55 0
  243.                     ops:      Hello World
  244.                } == 3;
  245.                Tt_message => procid <7.jOHHM X 129.144.153.55 0>
  246.  
  247.      To trace message flow in a specific, non-default session,
  248.  
  249.  
  250.           % ttttttttttttrrrraaaacccceeee ----SSSS """"01 15303 1342177284 1 0 13691 129.144.153.55 2""""
  251.  
  252. EEEENNNNVVVVIIIIRRRROOOONNNNMMMMEEEENNNNTTTT
  253.      ttttttttttttrrrraaaacccceeee is implemented purely as a ToolTalk client, using the message
  254.      interface to ttttttttsssseeeessssssssiiiioooonnnn and the following environmental hook into libtt.
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                                                                         PPPPaaaaggggeeee 4444
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ttttttttttttrrrraaaacccceeee((((1111))))                                                          ttttttttttttrrrraaaacccceeee((((1111))))
  269.  
  270.  
  271.  
  272.      TT_TRACE_SCRIPT
  273.           If set, tells libtt to turn on client-side tracing as specified in
  274.           the trace script.  If the first character of of the value is '.' or
  275.           '/', the value is taken to be the pathname of file containing the
  276.           trace script to use.  Otherwise, the value is taken to be an inline
  277.           trace script.
  278.  
  279. FFFFIIIILLLLEEEESSSS
  280.      $$$$TTTTMMMMPPPPDDDDIIIIRRRR////ttttttttttttrrrraaaacccceeee....nnnnnnnnnnnn A _n_a_m_e_d _p_i_p_e (see mmmmkkkkffffiiiiffffoooo(3C)) in $$$$TTTTMMMMPPPPDDDDIIIIRRRR (see
  281.                          tttteeeemmmmppppnnnnaaaammmm(3S)) from which trace output for _s_e_s_s_i_o_n is
  282.                          read when the ----oooo option is ommitted.
  283.  
  284. WWWWAAAARRRRNNNNIIIINNNNGGGGSSSS
  285.      Since (with the ----FFFF option) tracing can follow clients to remote hosts if
  286.      the environment is properly propagated, it is possible for different
  287.      processes in the same trace output to be labeled with the same process
  288.      id.
  289.  
  290. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  291.      ttttttttsssseeeessssssssiiiioooonnnn(1), ttttttttttttrrrraaaacccceeeeffffiiiilllleeee(4), the SSSSeeeessssssssiiiioooonnnn____TTTTrrrraaaacccceeee() ToolTalk request
  292.  
  293. DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
  294.      If _c_o_m_m_a_n_d is run, then ttttttttttttrrrraaaacccceeee will exit with the exit status of
  295.      _c_o_m_m_a_n_d.  Otherwise, exit codes are as follows:
  296.      0000    Normal termination.  Any _s_e_s_s_i_o_n tracing turned on by this
  297.           invocation of ttttttttttttrrrraaaacccceeee has now been turned off.
  298.      1111    Usage.  ttttttttttttrrrraaaacccceeee was given invalid command line options.
  299.      2222    Failure.  ttttttttttttrrrraaaacccceeee encountered an error while trying to do its job.
  300.           An error message has been emitted on standard error.
  301.      3333    Runaway _s_e_s_s_i_o_n tracing.  ttttttttttttrrrraaaacccceeee could not terminate tracing in
  302.           _s_e_s_s_i_o_n before exiting.
  303.      4444    Remote _s_e_s_s_i_o_n.  ttttttttsssseeeessssssssiiiioooonnnn is remote, and _o_u_t_f_i_l_e (if given) is not
  304.           visible there.  Choose a visible file, or run ttttttttttttrrrraaaacccceeee on that remote
  305.           host.
  306.      5555    Old _s_e_s_s_i_o_n.  The ttttttttsssseeeessssssssiiiioooonnnn for _s_e_s_s_i_o_n does not support the
  307.           Session_Trace() request.  Run kkkkiiiillllllll ----UUUUSSSSRRRR1111 on it to turn on old-style
  308.           tracing.
  309. NNNNOOOOTTTTEEEESSSS
  310.      For security purposes, client-side tracing is disabled inside a client
  311.      when its effective uid or gid is different from its real uid or gid and
  312.      the real uid is not the super-user.
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.                                                                         PPPPaaaaggggeeee 5555
  328.  
  329.  
  330.  
  331.